// 云函数入口文件
//根据商品类型id查询该类型的全部商品
const cloud = require("wx-server-sdk")

cloud.init({
    env: "cloudwx-dm78q"
})
DB = cloud.database().collection("supply");

// 云函数入口函数
exports.main = async (event, context) => {
    var marketId = event.marketId;
    var startDate = event.startDate;
    var endDate = event.endDate;
    var condition = {

    }
    if(marketId != ""){
        condition.marketId = marketId;
    }
    var allList = DB.where(condition).get();
    //console.log("allList:", allList);
    return allList;
}